Test Series - java script

Test Number 30/92

Q: What is the code snippet to go back to a history twice?
A. history(2);
B. history(-2);
C. history.go(-2);
D. history.go(2);
Solution: The go() method loads a specific URL from the history list. The above code snippet goes back 2, like clicking the Back button twice.
Q: If the window has child windows, how will the browsing histories be affected?
A. Numerically interleaved
B. Chronologically interleaved
C. Both Numerically and Chronologically interleaved
D. Numerically or Chronologically interleaved
Solution: If a window contains child windows, the browsing histories of the child windows are chronologically interleaved with the history of the main window. The opener property returns a reference to the window that created the window.
Q: The length property belongs to which of the following objects?
A. Window
B. Element
C. History
D. Document
Solution: The length property of the History object specifies the number of elements in the browsing history list. The property returns at least 1, because the list includes the currently loaded page.
Q: What is the datatype of the go() method’s parameter?
A. String
B. Integer
C. Double
D. Float
Solution: The go() method takes an integer argument and can skip any number of pages forward and backward in the history list.
Q: What is the special feature of modern web applications?
A. Can alter contents without loading document
B. Must load the document to manipulate
C. Remains static
D. Can’t be altered at all
Solution: Modern web applications can dynamically alter their own content without loading a new document.
Q: The navigator property belongs to which of the following object?
A. Document
B. Window
C. Navigator
D. Location
Solution: The navigator property of a Window object refers to a Navigator object that contains browser vendor and version number information. Navigator object property includes appCodeName, appVersion, appName etc.
Q: What is the vendor-neutral synonym for navigator?
A. staticData
B. purposeInformation
C. dataInformation
D. clientInformation
Solution: IE supports clientInformation as a vendor-neutral synonym for a navigator. The navigator property of a Window object refers to a Navigator object that contains browser vendor and version number information.
Q: Which is the preferred testing nowadays for scripting?
A. Software testing
B. Feature testing
C. Blackbox testing
D. Whitebox testing
Solution: The “browser-sniffing” approach is problematic because it requires constant tweaking as new browsers and new versions of existing browsers are introduced. Today, feature testing is preferred rather than making assumptions about particular browser versions and their features, you simply test for the feature (i.e., the method or property) you need.
Q: Which of the below properties can be used for browser sniffing?
A. platform
B. appVersion
C. both platform and appVersion
D. appName
Solution: The platform and appVersion can be found out in the navigator object properties.
Q: Where is the information of the userAgent property located?
A. appId
B. appName
C. platform
D. appVersion
Solution: The string that the browser sends in its USER-AGENT HTTP header. This property typically contains all the information in appVersion and may contain additional details as well.

You Have Score    /10